<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="" method="get" onsubmit="m3()">
    <input type="text" onkeyup="m1()"/>
    <input type="text" onkeydown="m2()"/>
    <input type="submit" value="提交"/>
</form>
<script type="text/javascript">
    function m1() {
        alert('键盘按下并弹起来了')
    }
    function m2() {
        alert('键盘按下了')
    }
    function m3() {
        alert('表单提交了')
    }
</script>
</body>
</html>